#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Created on 17-12-30
@author: yzw
@desc: 中间件，此处用于未登录的拦截
"""

from django.shortcuts import HttpResponseRedirect

try:
	from django.utils.deprecation import MiddlewareMixin
except ImportError:
	MiddlewareMixin = object


def process_request(request):
	print "傻逼你进来啊=====================>>>>>>>>>>>>>>>>>>"
	if request.session.get('phone', None) and request.session.get('name', None):
		pass
	else:
		return HttpResponseRedirect('/login')


class LoginMiddleware(MiddlewareMixin):
	def __init__(self):
		pass
